﻿// -------------------------------------------------------------------------
//    @FileName         :    NFServerLevelMgr.h
//    @Author           :    gaoyi
//    @Date             :    2024/12/19
//    @Email            :    445267987@qq.com
//    @Module           :    NFServerLevelMgr
//
// -------------------------------------------------------------------------

#pragma once


#include "NFComm/NFObjCommon/NFObject.h"
#include "NFLogicCommon/NFLogicShmTypeDefines.h"
#include <vector>
#include <NFComm/NFShmStl/NFShmHashMap.h>

class NFServerLevelMgr : public NF_OBJECT_GLOBAL_TEMPLATE_MACRO(NFServerLevelMgr, EOT_LOGIC_SERVER_LEVEL_ID, NFObject)
public:
    NFServerLevelMgr();
    
    virtual ~NFServerLevelMgr();
    
    int CreateInit();
    int ResumeInit();
public:
    //must be virtual
    virtual int OnTimer(int timeId, int callcount);
public:
    int Init();
    int UpdateServerLevel();
    int GetServerLevel() { return m_iServerLevel; }
    int GetOpenDays();
    int GetPlayerExpRate(int iLevel, double& fRate);
    int SetOpenTime(time_t tTime);
private:
    bool m_bIsInit;
    int m_iDayTimerId;
    int m_iServerLevel;
    time_t m_tOpenTime; //
};